package com.zl.bcyappserver.utils;

import java.io.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by ZhongLeiDev at 2019/12/6
 */
public class FileReadUtil {

    public static Set<String> getUidSetFromTxt(String filePath) throws IOException {
        Set<String> uidSet = new HashSet<>();
        File f = new File(filePath);
        FileInputStream fis = new FileInputStream(f);
        InputStreamReader inputReader = new InputStreamReader(fis);
        BufferedReader bf = new BufferedReader(inputReader);
        // 按行读取字符串
        String str;
        while ((str = bf.readLine()) != null) {
            uidSet.add(str);
        }
        bf.close();
        inputReader.close();
        return uidSet;
    }

}
